With the development and supply of hardware capable of reproducing and storing high resolution or high definition image content, a necessity for a codec that effectively encodes or decodes the high resolution or high definition image content is increasing. According to an existing video codec, a video is encoded according to a limited encoding scheme based on coding units having a tree structure.
Image data in a spatial domain is transformed into coefficients in a frequency domain by using frequency transformation. To perform a fast calculation in the frequency transformation, a video codec partitions an image into blocks having a predetermined size, performs a discrete cosine transform (DCT) transformation on each of the blocks, and thus encodes frequency coefficients in each block unit. Compared to the image data in the spatial domain, the coefficients in the frequency domain are easily compressed. Because an image pixel value in the spatial domain is expressed as a prediction error via inter prediction or intra prediction by the video codec, when the frequency transformation is performed on prediction errors, much data may be transformed into 0. The video codec decreases an amount of data by changing data, which sequentially and repeatedly occurs, into small-size data.